package com.xsfh.cruddemo.common;


import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class Result {
    String code;
    String msg;
    Map<String,Object> data = new HashMap<>();

    public static Result success(String msg){
        Result result = new Result();
        result.setCode("200");
        result.setMsg(msg);
        return result;
    }

    public Result data(String key,Object data){
        this.data.put(key,data);
        return this;
    }
}
